package com.xiashitech.agent.instrumentation.redis.lettuce.inst;

import com.google.auto.service.AutoService;
import com.xiashitech.agent.instrumentation.base.InstHelper;
import io.opentelemetry.javaagent.extension.instrumentation.InstrumentationModule;
import io.opentelemetry.javaagent.extension.instrumentation.TypeInstrumentation;

import java.util.Arrays;
import java.util.List;

/**
 * lettuce插桩模块
 * @author zhaoyk
 */
@AutoService(InstrumentationModule.class)
public class XSLettuceInstrumentationModule extends InstrumentationModule {

    public XSLettuceInstrumentationModule() {
        super("xs-lettuce");
    }

    @Override
    public List<TypeInstrumentation> typeInstrumentations() {
        return Arrays.asList(new XSLettuceInstrumentation(), new XSLettuceAsyncInstrumentation());
    }

    @Override
    public List<String> getAdditionalHelperClassNames() {
        return InstHelper.getHelperClasses(true,
                "com.xiashitech.agent.instrumentation.redis.lettuce.XsLettuceSingletons",
                "com.xiashitech.agent.instrumentation.redis.lettuce.XSLettuceProcessor",
                "com.xiashitech.agent.instrumentation.redis.lettuce.XSLettuceAsyncCallback",
                "com.xiashitech.agent.instrumentation.redis.lettuce.XSLettuceCompleteAction");
    }

}
